

const infoapp = new Vue({
  el: "#userInfo",
  data: {
    num : 0,
    userName:localStorage.getItem("name"),
  },

  methods: {

    loginOut(){

      console.log("退出登陆");
      localStorage.removeItem("name");
      localStorage.removeItem("loginId");

      window.location.href = "./login.html";

    }
    
  },
  created:function(){

    if (localStorage.getItem("loginId")) {
        var that = this;
        axios.get(BaseUrl + "client/unreadMessageByLoginId?loginId=" + localStorage.getItem("loginId")).then(
        function(response) {

          that.num = response.data.data[0].num;
          console.log("获取未读数 + ",that.num);
          console.log(response.data.data);

            
        },function(err) {

        });
    }else{

    }




  },
});



